$(function(){
    let userid=sessionStorage.getItem('userid');
    $.ajax({
        url:'http://139.9.177.51:3333/p2p/getuserinfo',
        type:'get',
        data:{userid:userid},
        dataTaye:'json',
        success:function(res){
            //console.log(res);
            if(res.code==200){
              //alert('成功')
               /*  $('#nickname').html(res.data.nickname)
                $('#username').html(res.data.username)
                $('#lastlogintime').html(res.data.lastlogintime)
                $('#totalmoney').html(res.data.totalmoney)
                $('#usablemoney').html(res.data.usablemoney)
                $('#blockedmoney').html(res.data.blockedmoney) */
                let data=res.data
                //遍历
                for(const key in data){
                   //console.log(data[key],key)
                    $(`#${key}`).html(data[key])
                }

            }else{
                alert('没有该用户的数据')
            }
        }
    })
    $('.btn-primary').click(function(){
        location.href='http://localhost:8080/recharge.html'
    })
})